import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import fire_component_msg from '@feidao/web/atom/browser/fsm/fire-component-msg';
import { anim, play } from '@feidao/animation';

export default async function (fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	console.log('初始组件：调用事件');
	fd.data.staff_number = args[0][0];
	console.log('-------------------------', fd.data.staff_number);
	fd.data.tab = 'tab1';//当前tab页签
	fd.data.content = 'c1';//当前tab内容
	//页签样式切换
	Array.from(fd.data.node.querySelectorAll<HTMLElement>('[data-feidao-id="tab"]')).forEach((t: HTMLElement) => {
		if (t.id == fd.data.tab) {
			t.classList.remove('bg-f4');
			t.classList.add(...'bg-1890ff color-fff'.split(' '));
		} else {
			t.classList.add('bg-f4');
			t.classList.remove(...'bg-1890ff color-fff'.split(' '));
		}
	});
	fd.fire('a004');//当前页签渲染
	play(anim(fd.data.node, {
	}, {
			right: {
				start: -1100,
				end: 0
			}
		}));
}
